<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_流程控制</title>
</head>
<body>
<script>
  /*let name = 'rose';
  if(!name){
    alert('用户名不能为空！')
  }else{
    alert('欢迎'+name+'回归！')
  }*/

  let gender = 1;
  switch(gender){
    case 1:
      console.log('男');
      break;
    case 2:
      console.log('女');
      break;
    default:
      console.log('未知');
  }
  /*普通for循环*/
  let names = ['张三','李四','王五'];
  for(let i = 0;i<names.length;i++){
      console.log(names[i]);
  }
  /*console.log(i);*/
  /*增强for循环*/
  for(let n of names){
      console.log(n)
  }
</script>

</body>
</html>